<?php

namespace app\models;

use app\models\common\admin\log\CommonActionLog;
use Yii;

/**
 * This is the model class for table "{{%goods_up_logs}}".
 *
 * @property integer $id
 * @property integer $source_name
 * @property string $source_goods_id
 * @property string $source_ip
 * @property string $goods_id
 * @property string $store_id
 * @property string $request_data
 * @property integer $status
 * @property integer $created_at
 * @property integer $updated_at
 */
class GoodsUpLogs extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return '{{%goods_up_logs}}';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['goods_id'], 'integer'],
            [['source_name', 'source_goods_id'], 'string']
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id'              => 'ID',
            'source_name'     => '来源名称',
            'source_goods_id' => '来源商品名称',
            'goods_id'        => '上传成功的商品ID',
            'store_id'        => '商城ID',
            'request_data'    => '请求数据',
            'status'          => '上传状态',
            'created_at'      => '创建时间',
            'updated_at'      => '更新时间'
        ];
    }

    public function afterFind(){
        $this->request_data = unserialize($this->request_data);
        parent::afterFind();
    }

}
